import {createBrowserRouter, RouteObject,Navigate} from 'react-router-dom'
import Main from '../pages/main.tsx'
import Home from '../pages/home'
import Mall from '../pages/mall'
import User from '../pages/user'
import PageOne from '../pages/other/pageOne'
import PageTwo from '../pages/other/pageTwo'
const router:RouteObject[]= [
    {
        path:'/',
       element:< Navigate to="home" replace />
    },
    {
        path:'/',
        Component:Main,
        children:[
            {
                path:'home',
                Component:Home,
            },
            {
                path:'mall',
                Component:Mall,
            },
            {
                path:'user',
                Component:User,
            },
            {
                path:'other',
                children:[
                    {
                        path:'pageOne',
                        Component:PageOne,
                    },
                    {
                        path:'pageTwo',
                        Component:PageTwo,
                    },
                ]
            },
            ]
    },
]
// eslint-disable-next-line react-refresh/only-export-components
export default createBrowserRouter(router)